<?php
//报告所有错误
require_once "dbconn.php";
$data=array();

//全部
$sql = "SELECT CONCAT(0 + sum(amount)) as value from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id != 35 GROUP BY ool.order_id )";

//echo $sql."<br/>";


$query=$mysqli->query($sql);
$res=mysqli_fetch_array($query);


//今天
$sql1 = "select sum(amount)  as value from o_order where   date_format(create_time,'%Y-%m-%d')=date_format(now(),'%Y-%m-%d')  and  ( status=7 or `status`=2 or `status`=3 or `status`=4 or `status`=5 ) ";


$query1=$mysqli->query($sql1);
$res1=mysqli_fetch_array($query1);

//昨天
$sql2 = "select sum(amount)  as value from o_order where  date_format(create_time,'%Y-%m-%d')= date_format(date_sub(now(),interval 1 day),'%Y-%m-%d')  and  ( status=7 or  `status`=2 or `status`=3 or `status`=4 or `status`=5 ) ";

$query2=$mysqli->query($sql2);
$res2=mysqli_fetch_array($query2);


$jsonStr["all"] = number_format($res['value'],2);
$jsonStr["today"] = number_format($res1['value'],2);
$jsonStr["yesterday"] = number_format($res2['value'],2);




//生产中心月目标


//订单及配送

$sql41="SELECT * from (SELECT product_name,create_time,sum(amount) as am,count(1) as sl from o_order where (date_format(create_time, '%Y-%m') = date_format(now(), '%Y-%m')) and ( `status`=4 or `status`=5) GROUP BY product_name) as p ";

$query41=$mysqli->query($sql41);
//$res41=mysqli_fetch_array($query41);
$t=array();
while($arr3 = mysqli_fetch_assoc($query41)){

if($arr3['product_name']=="上海生产中心"){

	$t['1']=number_format($arr3['sl'],2);
	
}
if($arr3['product_name']=="广州生产中心"){

	$t['2']=number_format($arr3['sl'],2);

}
if($arr3['product_name']=="贵阳生产中心"){

	$t['3']=number_format($arr3['sl'],2);

}
if($arr3['product_name']=="长沙生产中心"){

	$t['4']=number_format($arr3['sl'],2);

}

}


$sql411="SELECT * from (SELECT product_name,create_time,sum(amount) as am,count(1) as sl from o_order where date_format(create_time, '%Y-%m') = date_format(now(), '%Y-%m') and (  `status`=1 ) GROUP BY product_name) as p ";
$query411=$mysqli->query($sql411);
//$res41=mysqli_fetch_array($query41);
$t411=array();

while($arr411 = mysqli_fetch_assoc($query411)){

if($arr411['product_name']=="上海生产中心"){

	$t411['1']=round($arr411['am'],2);
	
}
if($arr411['product_name']=="广州生产中心"){

	$t411['2']=round($arr411['am'],2);

}
if($arr411['product_name']=="贵阳生产中心"){

	$t411['3']=round($arr411['am'],2);

}
if($arr411['product_name']=="长沙生产中心"){

	$t411['4']=round($arr411['am'],2);

}

}


$sql5="SELECT * from (SELECT product_name,create_time,sum(amount) as am,count(1) as sl from o_order where date_format(create_time, '%Y-%m') = date_format(now(), '%Y-%m') and (`status`=5 ) GROUP BY product_name) as p ";
$query5=$mysqli->query($sql5);
//$res41=mysqli_fetch_array($query41);
$t5=array();

while($arr5 = mysqli_fetch_assoc($query5)){

if($arr5['product_name']=="上海生产中心"){

	$t5['1']=round($arr5['am'],2);
	
}
if($arr5['product_name']=="广州生产中心"){

	$t5['2']=round($arr5['am'],2);

}
if($arr5['product_name']=="贵阳生产中心"){

	$t5['3']=round($arr5['am'],2);

}
if($arr5['product_name']=="长沙生产中心"){

	$t5['4']=round($arr5['am'],2);

}

}



$sql6="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id != 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m') GROUP BY ool.order_id ) group by product_name";
$query6=$mysqli->query($sql6);
$t6=array();
while($arr6 = mysqli_fetch_assoc($query6)){

if($arr6['product_name']=="上海生产中心"){

	$t6['1']=round($arr6['am'],2);
	
}
if($arr5['product_name']=="广州生产中心"){

	$t6['2']=round($arr6['am'],2);

}
if($arr5['product_name']=="贵阳生产中心"){

	$t6['3']=round($arr6['am'],2);

}
if($arr5['product_name']=="长沙生产中心"){

	$t6['4']=round($arr6['am'],2);

}

}


//支付宝
$sql7="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id != 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m') and oo.pay_way=1 GROUP BY ool.order_id ) group by product_name";
$query7=$mysqli->query($sql7);
$t7=array();
while($arr7 = mysqli_fetch_assoc($query7)){

if($arr7['product_name']=="上海生产中心"){

	$t7['1']=round($arr7['am'],2);
	
}
if($arr7['product_name']=="广州生产中心"){

	$t7['2']=round($arr7['am'],2);

}
if($arr7['product_name']=="贵阳生产中心"){

	$t7['3']=round($arr7['am'],2);

}
if($arr7['product_name']=="长沙生产中心"){

	$t7['4']=round($arr7['am'],2);

}

}


//微信
$sql8="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id != 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m') and oo.pay_way=2 GROUP BY ool.order_id ) group by product_name";

$query8=$mysqli->query($sql8);
$t8=array();
while($arr8 = mysqli_fetch_assoc($query8)){

if($arr8['product_name']=="上海生产中心"){

	$t8['1']=round($arr8['am'],2);
	
}
if($arr8['product_name']=="广州生产中心"){

	$t8['2']=round($arr8['am'],2);

}
if($arr8['product_name']=="贵阳生产中心"){

	$t8['3']=round($arr8['am'],2);

}
if($arr8['product_name']=="长沙生产中心"){

	$t8['4']=round($arr8['am'],2);

}
}


$sql9="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id != 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m') and oo.pay_way=3 GROUP BY ool.order_id ) group by product_name";


$query9=$mysqli->query($sql9);
$t9=array();
while($arr9 = mysqli_fetch_assoc($query9)){

if($arr9['product_name']=="上海生产中心"){

	$t9['1']=round($arr9['am'],2);
	
}
if($arr9['product_name']=="广州生产中心"){

	$t9['2']=round($arr9['am'],2);

}
if($arr9['product_name']=="贵阳生产中心"){

	$t9['3']=round($arr9['am'],2);

}
if($arr9['product_name']=="长沙生产中心"){

	$t9['4']=round($arr9['am'],2);

}

}

//充值金额

$sql10="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id = 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m')  GROUP BY ool.order_id ) group by product_name";


$query10=$mysqli->query($sql10);
$t10=array();
while($arr10 = mysqli_fetch_assoc($query10)){

if($arr10['product_name']=="上海生产中心"){

	$t10['1']=round($arr10['am'],2);
	
}
if($arr10['product_name']=="广州生产中心"){

	$t10['2']=round($arr10['am'],2);

}
if($arr10['product_name']=="贵阳生产中心"){

	$t10['3']=round($arr10['am'],2);

}
if($arr10['product_name']=="长沙生产中心"){

	$t10['4']=round($arr10['am'],2);

}

}

$sql11="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id = 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m')  GROUP BY ool.order_id ) group by product_name";


$query11=$mysqli->query($sql11);
$t11=array();
while($arr11 = mysqli_fetch_assoc($query11)){

if($arr11['product_name']=="上海生产中心"){

	$t11['1']=round($arr11['am'],2);
	
}
if($arr11['product_name']=="广州生产中心"){

	$t11['2']=round($arr11['am'],2);

}
if($arr11['product_name']=="贵阳生产中心"){

	$t11['3']=round($arr11['am'],2);

}
if($arr11['product_name']=="长沙生产中心"){

	$t11['4']=round($arr11['am'],2);

}

}

$sql12="SELECT product_name,sum(amount) as am from o_order WHERE id in(SELECT oo.id FROM o_order oo LEFT JOIN o_order_list ool ON ool.order_id = oo.id WHERE ( oo.STATUS = 7 OR oo.`status` = 2 OR oo.`status` = 3 OR oo.`status` = 4 OR oo.`status` = 5) AND ool.goods_id = 35 and date_format(oo.create_time,'%Y-%m')=date_format(now(),'%Y-%m')  GROUP BY ool.order_id ) group by product_name";


$query12=$mysqli->query($sql12);
$t12=array();
while($arr12 = mysqli_fetch_assoc($query12)){

if($arr12['product_name']=="上海生产中心"){

	$t12['1']=round($arr12['am'],2);
	
}
if($arr12['product_name']=="广州生产中心"){

	$t12['2']=round($arr12['am'],2);

}
if($arr12['product_name']=="贵阳生产中心"){

	$t12['3']=round($arr12['am'],2);

}
if($arr12['product_name']=="长沙生产中心"){

	$t12['4']=round($arr12['am'],2);

}




}











/*******************************/

$sql4="SELECT * from (SELECT product_name,create_time,sum(amount) as am,count(1) as sl from o_order where date_format(create_time, '%Y-%m') = date_format(now(), '%Y-%m') and (  `status`=2 or `status`=3 or `status`=4 or `status`=5 ) GROUP BY product_name) as p ";
$query4=$mysqli->query($sql4);
//$res4=mysqli_fetch_array($query4);



while ($row4=mysqli_fetch_assoc($query4)){


	
	if($row4['product_name']=="上海生产中心"){

		$jsonStr['sczxymb']["sczx"]="上海生产中心";
		$jsonStr['sczxymb']["ymb"]=number_format(950000,2);//暂无数据
		$jsonStr['sczxymb']["dqyye"]=number_format($row4['am'],2);
		$jsonStr['sczxymb']["wcl"]=round(($row4['am']/950000)*100,2);



		$jsonStr['shddjps']['ddsl']=round($row4['sl'],0);

		if(isset($t['1'])){
			$jsonStr['shddjps']['psdd']=round($t['1'],0);
			$jsonStr['shddjps']['psddb']=round($jsonStr['shddjps']['psdd']/3000*100,0);

		}else{
			$jsonStr['shddjps']['psdd']=0;
			$jsonStr['shddjps']['psddb']=0;

		}
		

		$jsonStr['shddjps']['ddslb']=round($row4['sl']/3000*100,0);



		$jsonStr['shsczx']['ddje']=number_format($row4['am'],2);



		if(isset($t411['1'])){
			$jsonStr['shsczx']['ds']=number_format($t411['1'],2);

		}else{
			$jsonStr['shsczx']['ds']=0;
		}





        if(isset($t5['1'])){
			$jsonStr['shsczx']['tkje']=number_format($t5['1'],2);

		}else{
			$jsonStr['shsczx']['tkje']=0;
		}

		

 		if(isset($t6['1'])){

			$jsonStr['shsczx']['zfys']=number_format($t6['1'],2);


			$t6v=round($t6['1'],2);

		}else{
			$jsonStr['shsczx']['zfys']=0;
			$t6v=0;
		}



		if(isset($t7['1'])){
			$jsonStr['shsczx']['zfzfb']=number_format($t7['1'],2);
		
			$t7v=round($t7['1'],2);
		}else{
			$jsonStr['shsczx']['zfzfb']=0;

			$t7v=0;
		}




		if(isset($t8['1'])){

			$jsonStr['shsczx']['zfwx']=number_format($t8['1'],2);
			$t8v=round($t8['1'],2);
		}else{
			$jsonStr['shsczx']['zfwx']=0;
			$t8v=0;
		}



		if(isset($t9['1'])){

			$jsonStr['shsczx']['zfye']=number_format($t9['1'],2);
			$t9v=round($t9['1'],2);
		}else{
			$jsonStr['shsczx']['zfye']=0;
			$t9v=0;
		}




		if(isset($t10['1'])){
		$jsonStr['shsczx']['cz']=number_format($t10['1'],2);
			$t10v=round($t10['1'],2);
		}else{
			$jsonStr['shsczx']['cz']=0;
			$t10v=0;
		}



		if(isset($t11['1'])){

			$jsonStr['shsczx']['czzfb']=number_format($t11['1'],2);
			$t11v=round($t11['1'],2);
		}else{
			$jsonStr['shsczx']['czzfb']=0;
			$t11v=0;
		}


		if(isset($t12['1'])){
			$jsonStr['shsczx']['czwx']=number_format($t12['1'],2);
			$t12v=round($t12['1'],2);
		}else{
			$jsonStr['shsczx']['czwx']=0;
			$t12v=0;
		}




$allmoney=$t7v+$t8v+$t9v;
$jsonStr['shsczx']['zfalipayoccupies']=@round(($t8v/$allmoney)*100,2);
$jsonStr['shsczx']['zfweChatoccupies']=@round(($t7v/$allmoney)*100,2);
$jsonStr['shsczx']['zfbalanceaccount']=@round(($t9v/$allmoney)*100,2);

$jsonStr['shsczx']['czalipayoccupies']=@round(($t11v/$t10v)*100,2);
$jsonStr['shsczx']['czweChatoccupies']=@round(($t12v/$t10v)*100,2);






	}

	if($row4['product_name']=="广州生产中心"){



		$jsonStr['gzsczxymb']["sczx"]="广州生产中心";
		$jsonStr['gzsczxymb']["ymb"]=number_format(950000,2);//暂无数据
		$jsonStr['gzsczxymb']["dqyye"]=number_format($row4['am'],2);
		$jsonStr['gzsczxymb']["wcl"]=round(($row4['am']/950000)*100,2);







		$jsonStr['gzddjps']['ddsl']=round($row4['sl'],0);

		if(isset($t['2'])){
			$jsonStr['gzddjps']['psdd']=round($t['2'],0);
			$jsonStr['gzddjps']['psddb']=round($jsonStr['gzddjps']['psdd']/3000*100,0);

		}else{
			$jsonStr['gzddjps']['psdd']=0;
			$jsonStr['gzddjps']['psddb']=0;
		}
		

		$jsonStr['gzddjps']['ddslb']=round($row4['sl']/3000*100,0);




		$jsonStr['gzsczx']['ddje']=number_format($row4['am'],2);
		
		if(isset($t411['2'])){
			$jsonStr['gzsczx']['ds']=number_format($t411['2'],2);

		}else{
			$jsonStr['gzsczx']['ds']=0;
		}






		  if(isset($t5['2'])){
			$jsonStr['gzsczx']['tkje']=number_format($t5['2'],2);

		}else{
			$jsonStr['gzsczx']['tkje']=0;
		}




 		if(isset($t6['2'])){

			$jsonStr['gzsczx']['zfys']=number_format($t6['2'],2);


			$t6v=round($t6['2'],2);

		}else{
			$jsonStr['gzsczx']['zfys']=0;
			$t6v=0;
		}


		if(isset($t7['2'])){
			$jsonStr['gzsczx']['zfzfb']=number_format($t7['2'],2);
		
			$t7v=round($t7['2'],2);
		}else{
			$jsonStr['gzsczx']['zfzfb']=0;

			$t7v=0;
		}




		if(isset($t8['2'])){

			$jsonStr['gzsczx']['zfwx']=number_format($t8['2'],2);
			$t8v=round($t8['2'],2);
		}else{
			$jsonStr['gzsczx']['zfwx']=0;
			$t8v=0;
		}



		if(isset($t9['2'])){

			$jsonStr['gzsczx']['zfye']=number_format($t9['2'],2);
			$t9v=round($t9['2'],2);
		}else{
			$jsonStr['gzsczx']['zfye']=0;
			$t9v=0;
		}




		if(isset($t10['2'])){
		$jsonStr['gzsczx']['cz']=number_format($t10['2'],2);
			$t10v=round($t10['2'],2);
		}else{
			$jsonStr['gzsczx']['cz']=0;
			$t10v=0;
		}



		if(isset($t11['2'])){

			$jsonStr['gzsczx']['czzfb']=number_format($t11['2'],2);
			$t11v=round($t11['2'],2);
		}else{
			$jsonStr['gzsczx']['czzfb']=0;
			$t11v=0;
		}


		if(isset($t12['2'])){
			$jsonStr['gzsczx']['czwx']=number_format($t12['2'],2);
			$t12v=round($t12['2'],2);
		}else{
			$jsonStr['gzsczx']['czwx']=0;
			$t12v=0;
		}




$allmoney=$t7v+$t8v+$t9v;
$jsonStr['gzsczx']['zfalipayoccupies']=@round(($t8v/$allmoney)*100,2);
$jsonStr['gzsczx']['zfweChatoccupies']=@round(($t7v/$allmoney)*100,2);
$jsonStr['gzsczx']['zfbalanceaccount']=@round(($t9v/$allmoney)*100,2);

$jsonStr['gzsczx']['czalipayoccupies']=@round(($t11v/$t10v)*100,2);
$jsonStr['gzsczx']['czweChatoccupies']=@round(($t12v/$t10v)*100,2);







	}



	if($row4['product_name']=="贵阳生产中心"){



		$jsonStr['gysczxymb']["sczx"]="贵阳生产中心";
		$jsonStr['gysczxymb']["ymb"]=number_format(950000,2);//暂无数据
		$jsonStr['gysczxymb']["dqyye"]=number_format($row4['am'],2);
		$jsonStr['gysczxymb']["wcl"]=round(($row4['am']/950000)*100,2);



		$jsonStr['gyddjps']['ddsl']=round($row4['sl'],0);

		if(isset($t['3'])){
			$jsonStr['gyddjps']['psdd']=round($t['3'],0);
			$jsonStr['gyddjps']['psddb']=round($jsonStr['gyddjps']['psdd']/3000*100,0);
		}else{
			$jsonStr['gyddjps']['psdd']=0;
			$jsonStr['gyddjps']['psddb']=0;
		}
		

		$jsonStr['gyddjps']['ddslb']=round($row4['sl']/3000*100,0);




		$jsonStr['gyddjps']['ddje']=number_format($row4['am'],2);
		
		if(isset($t411['3'])){
			$jsonStr['gyddjps']['ds']=number_format($t411['3'],2);

		}else{
			$jsonStr['gyddjps']['ds']=0;
		}
		



		  if(isset($t5['3'])){
			$jsonStr['gyddjps']['tkje']=number_format($t5['3'],2);

		}else{
			$jsonStr['gyddjps']['tkje']=0;
		}









 		if(isset($t6['3'])){

			$jsonStr['gysczx']['zfys']=number_format($t6['3'],2);


			$t6v=round($t6['3'],2);

		}else{
			$jsonStr['gysczx']['zfys']=0;
			$t6v=0;
		}


		if(isset($t7['3'])){
		$jsonStr['gysczx']['zfzfb']=number_format($t7['3'],2);
		
			$t7v=round($t7['3'],2);
		}else{
			$jsonStr['gysczx']['zfzfb']=0;

			$t7v=0;
		}




		if(isset($t8['3'])){

			$jsonStr['gysczx']['zfwx']=number_format($t8['3'],2);
			$t8v=round($t8['3'],2);
		}else{
			$jsonStr['gysczx']['zfwx']=0;
			$t8v=0;
		}



		if(isset($t9['3'])){

			$jsonStr['gysczx']['zfye']=number_format($t9['3'],2);
			$t9v=round($t9['3'],2);
		}else{
			$jsonStr['gysczx']['zfye']=0;
			$t9v=0;
		}




		if(isset($t10['3'])){
		$jsonStr['gysczx']['cz']=number_format($t10['3'],2);
			$t10v=round($t10['3'],2);
		}else{
			$jsonStr['gysczx']['cz']=0;
			$t10v=0;
		}



		if(isset($t11['3'])){

			$jsonStr['gysczx']['czzfb']=number_format($t11['3'],2);
			$t11v=round($t11['3'],2);
		}else{
			$jsonStr['gysczx']['czzfb']=0;
			$t11v=0;
		}


		if(isset($t12['3'])){
			$jsonStr['gysczx']['czwx']=number_format($t12['3'],2);
			$t12v=round($t12['3'],2);
		}else{
			$jsonStr['gysczx']['czwx']=0;
			$t12v=0;
		}




$allmoney=$t7v+$t8v+$t9v;
$jsonStr['gysczx']['zfalipayoccupies']=@round(($t8v/$allmoney)*100,2);
$jsonStr['gysczx']['zfweChatoccupies']=@round(($t7v/$allmoney)*100,2);
$jsonStr['gysczx']['zfbalanceaccount']=@round(($t9v/$allmoney)*100,2);

$jsonStr['gysczx']['czalipayoccupies']=@round(($t11v/$t10v)*100,2);
$jsonStr['gysczx']['czweChatoccupies']=@round(($t12v/$t10v)*100,2);






	}

	if($row4['product_name']=="长沙生产中心"){



		$jsonStr['cssczxymb']["sczx"]="长沙生产中心";
		$jsonStr['cssczxymb']["ymb"]=number_format(950000,2);//暂无数据
		$jsonStr['cssczxymb']["dqyye"]=number_format($row4['am'],2);
		$jsonStr['cssczxymb']["wcl"]=round(($row4['am']/950000)*100,2);


		$jsonStr['csddjps']['ddsl']=round($row4['sl'],0);

		if(isset($t['4'])){
			$jsonStr['csddjps']['psdd']=round($t['4'],0);
			$jsonStr['csddjps']['psddb']=round($jsonStr['csddjps']['psdd']/3000*100,0);
		}else{
			$jsonStr['csddjps']['psdd']=0;
			$jsonStr['csddjps']['psddb']=0;
		}
		

		$jsonStr['csddjps']['ddslb']=round($row4['sl']/3000*100,0);







		$jsonStr['csddjps']['ddje']=number_format($row4['am'],2);
		


		if(isset($t411['4'])){
			$jsonStr['csddjps']['ds']=number_format($t411['4'],2);

		}else{
			$jsonStr['csddjps']['ds']=0;
		}
		





		 if(isset($t5['4'])){
			$jsonStr['csddjps']['tkje']=number_format($t5['4'],2);

		}else{
			$jsonStr['csddjps']['tkje']=0;
		}




 		if(isset($t6['4'])){

			$jsonStr['cssczx']['zfys']=number_format($t6['4'],2);


			$t6v=round($t6['4'],2);

		}else{
			$jsonStr['cssczx']['zfys']=0;
			$t6v=0;
		}


		if(isset($t7['4'])){
		$jsonStr['cssczx']['zfzfb']=number_format($t7['4'],2);
		
			$t7v=round($t7['4'],2);
		}else{
			$jsonStr['cssczx']['zfzfb']=0;

			$t7v=0;
		}




		if(isset($t8['4'])){

			$jsonStr['cssczx']['zfwx']=number_format($t8['4'],2);
			$t8v=round($t8['4'],2);
		}else{
			$jsonStr['cssczx']['zfwx']=0;
			$t8v=0;
		}



		if(isset($t9['4'])){

			$jsonStr['cssczx']['zfye']=number_format($t9['4'],2);
			$t9v=round($t9['4'],2);
		}else{
			$jsonStr['cssczx']['zfye']=0;
			$t9v=0;
		}




		if(isset($t10['4'])){
		$jsonStr['cssczx']['cz']=number_format($t10['4'],2);
			$t10v=round($t10['4'],2);
		}else{
			$jsonStr['cssczx']['cz']=0;
			$t10v=0;
		}



		if(isset($t11['4'])){

			$jsonStr['cssczx']['czzfb']=number_format($t11['4'],2);
			$t11v=round($t11['4'],2);
		}else{
			$jsonStr['cssczx']['czzfb']=0;
			$t11v=0;
		}


		if(isset($t12['4'])){
			$jsonStr['cssczx']['czwx']=number_format($t12['4'],2);
			$t12v=round($t12['4'],2);
		}else{
			$jsonStr['cssczx']['czwx']=0;
			$t12v=0;
		}




$allmoney=$t7v+$t8v+$t9v;
$jsonStr['cssczx']['zfalipayoccupies']=@round(($t8v/$allmoney)*100,2);
$jsonStr['cssczx']['zfweChatoccupies']=@round(($t7v/$allmoney)*100,2);
$jsonStr['cssczx']['zfbalanceaccount']=@round(($t9v/$allmoney)*100,2);

$jsonStr['cssczx']['czalipayoccupies']=@round(($t11v/$t10v)*100,2);
$jsonStr['cssczx']['czweChatoccupies']=@round(($t12v/$t10v)*100,2);






	}
}






mysqli_close($mysqli); 

echo jsonSuccess($jsonStr);

?>